package com.xjh.basestudy.javabase.exception;

public class Exceptionthrows {
    public static void main(String[] args)throws Exception{
        System.out.println("开始");
        method();
        System.out.println("结束");

    }
    //thrwos抛出所有的异常信息
    public static void method() throws Exception{

            int[] arr = {1,2,3};
            try {
                System.out.println(arr[3]);

            }catch (ArrayIndexOutOfBoundsException e){
                System.out.println("数组越界");
            }


    }

}
